package com.team10.hotel.controller;

import com.team10.hotel.domain.Country;
import com.team10.hotel.service.CountryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/country")
public class CountryController {

    @Autowired
    private CountryService countryService;

    @RequestMapping("/getAll")
    public String getAllCountry(Model model){
        List<Country> countryList=countryService.findAll();
        model.addAttribute("countryList",countryList);
        return "countryList";
    }
}
